<template>
  <div>
    <h1 v-if="allowed" style="color: green;">Allow</h1>
    <h1 v-else style="color: red;">Deny</h1>
  </div>
</template>

<script>
export default {
  beforeRouteEnter(to, from, next) {
    next(vm => {
      vm.allowed = to.params.allow
    });
  },
  // beforeRouteUpdate(to, from, next) {},
  // beforeRouteLeave(to, from, next) {},
  data() {
    return {
      allowed: false
    };
  }
};
</script>

<style>
</style>